package com.fantsey.pattern.abstractFactory;

public class AbstractFactoryPatternDemo {
    public static void main(String[] args) {
        // 通过工厂类类型SHAPE,来获取到抽象工厂类
        AbstractFactory abstractFactory1 = FactoryProducer.getFactory("SHAPE");
        // 通过工厂类型 CIRCLE, 来获取对应的工厂
        Shape shape1 = abstractFactory1.getShape("CIRCLE");
        shape1.draw();

        AbstractFactory abstractFactory2 = FactoryProducer.getFactory("COLOR");
        Color color = abstractFactory2.getColor("GREEN");
        color.fill();
    }
}
